Skip to content

feat(leaderboards): add value search#894

Draft
ugcodrr wants to merge 2 commits into
mainfrom
feat/leaderboard-value-search
Draft

feat(leaderboards): add value search#894
ugcodrr wants to merge 2 commits into
mainfrom
feat/leaderboard-value-search

Conversation

@ugcodrr

@ugcodrr ugcodrr commented Jun 11, 2026

Copy link
Copy Markdown
Member
  • Add leaderboard search by score value for player and guild leaderboards.
  • Support value inputs with suffixes like k, m, b, and t

@vercel

vercel Bot commented Jun 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
statsify Ignored Ignored Preview Jun 13, 2026 10:26am

@ugcodrr ugcodrr marked this pull request as ready for review June 11, 2026 05:47
@ugcodrr ugcodrr requested a review from jacobk999 June 11, 2026 05:47
await this.redis.zrangebyscore(key, value, "+inf", "LIMIT", 0, 1) :
await this.redis.zrevrangebyscore(key, value, "-inf", "LIMIT", 0, 1);

const fallback = sort === "ASC" ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure we should have a fallback here? If there is no player with the value it should probably just error.

sort
);
highlight = ranking - 1;
top = highlight - (highlight % 10);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should be highlight % PAGE_SIZE. I think the code above also needs to be changed while you are at it.

const data = interaction.getData();
const valueInput = data.components[0].components[0].value;

const value = parseLeaderboardValue(valueInput);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this actually works? For example if it is a level leaderboard, it is actually sorting by the exp value however the user would probably be searching by the level not the exact exp someone has. Furthermore if it was a leaderboard involving time, you would need to parse the formatted time string like 1:23. I am not sure there is a good way to do this currently and provide a good experience without some changes to the schema system.

@jacobk999 jacobk999 marked this pull request as draft June 11, 2026 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants